home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / os / sprite / tmp < prev    next >
Encoding:
Text File  |  1992-01-10  |  47.1 KB  |  6,296 lines

  1. # 1 "access.c"
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. # 1 "/X11/R4/lib/include/X11/Xos.h" 1
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. # 42 "/X11/R4/lib/include/X11/Xos.h"
  60.  
  61. # 1 "/sprite/lib/include/sys/types.h" 1
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. typedef    unsigned char    u_char;
  97. typedef    unsigned short    u_short;
  98. typedef    unsigned int    u_int;
  99. typedef    unsigned long    u_long;
  100. typedef    unsigned short    ushort;         
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125. typedef struct _quad {long val[2]; } quad;
  126. typedef    struct    _uquad {unsigned long val[2]; } u_quad;
  127.  
  128. typedef    long    daddr_t;
  129. typedef    char *    caddr_t;
  130. typedef    long *    qaddr_t;     
  131. typedef    u_long    ino_t;
  132. typedef    long    swblk_t;
  133.  
  134.  
  135. typedef    int    size_t;
  136.  
  137.  
  138.  
  139. typedef    long    time_t;
  140.  
  141.  
  142.  
  143. typedef    long    clock_t;
  144.  
  145. typedef    short    dev_t;
  146. typedef    long    off_t;
  147. typedef    short    uid_t;
  148. typedef    short    gid_t;
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156. typedef int    pid_t;
  157.  
  158. typedef long    key_t;         
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171. typedef long    fd_mask;
  172.  
  173.  
  174.  
  175.  
  176.  
  177. typedef    struct fd_set {
  178.     fd_mask    fds_bits[(((256 )+(( (sizeof(fd_mask) * 8        )    )-1))/( (sizeof(fd_mask) * 8        )    )) ];
  179. } fd_set;
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187. # 43 "/X11/R4/lib/include/X11/Xos.h" 2
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214. # 1 "/sprite/lib/include/strings.h" 1
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230. char    *strcat();
  231. char    *strncat();
  232. int    strcmp();
  233. int    strncmp();
  234. int    strcasecmp();
  235. int    strncasecmp();
  236. char    *strcpy();
  237. char    *strncpy();
  238. int    strlen();
  239. char    *index();
  240. char    *rindex();
  241.  
  242.  
  243. char    *memccpy();
  244. char    *memchr();
  245. int    memcmp();
  246. char    *memcpy();
  247. char    *memset();
  248. char    *strchr();
  249. char    *strdup();
  250. char    *strrchr();
  251. char    *strpbrk();
  252. char    *strsep();
  253. int    strspn();
  254. int    strcspn();
  255. char    *strtok();
  256.  
  257.  
  258. char    *strerror();
  259.  
  260.  
  261. # 69 "/X11/R4/lib/include/X11/Xos.h" 2
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274. # 1 "/sprite/lib/include/sys/file.h" 1
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374. # 81 "/X11/R4/lib/include/X11/Xos.h" 2
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385. # 120 "/X11/R4/lib/include/X11/Xos.h"
  386.  
  387. # 1 "/sprite/lib/include/sys/time.h" 1
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. # 1 "/sprite/lib/include/cfuncproto.h" 1
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472. typedef char *_VoidPtr;
  473.  
  474.  
  475.  
  476.  
  477.  
  478. # 13 "/sprite/lib/include/sys/time.h" 2
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485. struct timeval {
  486.     long    tv_sec;         
  487.     long    tv_usec;     
  488. };
  489.  
  490. struct timezone {
  491.     int    tz_minuteswest;     
  492.     int    tz_dsttime;     
  493. };
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521. struct    itimerval {
  522.     struct    timeval it_interval;     
  523.     struct    timeval it_value;     
  524. };
  525.  
  526.  
  527. # 1 "/sprite/lib/include/time.h" 1
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539. # 1 "/sprite/lib/include/cfuncproto.h" 1
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559. # 76 "/sprite/lib/include/cfuncproto.h"
  560.  
  561.  
  562. # 12 "/sprite/lib/include/time.h" 2
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577. struct tm {
  578.     int    tm_sec;
  579.     int    tm_min;
  580.     int    tm_hour;
  581.     int    tm_mday;
  582.     int    tm_mon;
  583.     int    tm_year;
  584.     int    tm_wday;
  585.     int    tm_yday;
  586.     int    tm_isdst;
  587.     long    tm_gmtoff;
  588.     char    *tm_zone;
  589. };
  590.  
  591.         extern  clock_t clock () ;
  592.         extern  time_t time () ;
  593.         extern  time_t mktime () ;
  594.         extern  double difftime () ;
  595.         extern  struct tm *gmtime () ;
  596.         extern  struct tm *localtime () ;
  597.         extern  char *asctime () ;
  598.         extern  char *ctime () ;
  599.         extern  int strftime () ;
  600.  
  601.  
  602.  
  603. # 61 "/sprite/lib/include/sys/time.h" 2
  604.  
  605.  
  606.  
  607.         extern  int    getitimer () ;
  608.         extern  int    gettimeofday () ;
  609.  
  610.         extern  int    settimeofday () ;
  611.  
  612.         extern  int    setitimer () ;
  613.  
  614.         extern  int    utimes () ;
  615.  
  616.  
  617.  
  618. # 121 "/X11/R4/lib/include/X11/Xos.h" 2
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644. # 27 "access.c" 2
  645.  
  646. # 1 "/X11/R4/lib/include/X11/X.h" 1
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684. typedef unsigned long XID;
  685.  
  686. typedef XID Window;
  687. typedef XID Drawable;
  688. typedef XID Font;
  689. typedef XID Pixmap;
  690. typedef XID Cursor;
  691. typedef XID Colormap;
  692. typedef XID GContext;
  693. typedef XID KeySym;
  694.  
  695. typedef unsigned long Mask;
  696.  
  697. typedef unsigned long Atom;
  698.  
  699. typedef unsigned long VisualID;
  700.  
  701. typedef unsigned long Time;
  702.  
  703. typedef unsigned char KeyCode;
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.                
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949. # 311 "/X11/R4/lib/include/X11/X.h"
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299. # 28 "access.c" 2
  1300.  
  1301. # 1 "/X11/R4/lib/include/X11/Xproto.h" 1
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354. # 1 "/X11/R4/lib/include/X11/Xmd.h" 1
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444. typedef long           INT32;
  1445. typedef short          INT16;
  1446. typedef char           INT8;
  1447.  
  1448. typedef unsigned long CARD32;
  1449. typedef unsigned short CARD16;
  1450. typedef unsigned char  CARD8;
  1451.  
  1452. typedef unsigned long        BITS32;
  1453. typedef unsigned short        BITS16;
  1454. typedef unsigned char        BYTE;
  1455.  
  1456. typedef unsigned char            BOOL;
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.   
  1490.  
  1491.  
  1492.  
  1493.  
  1494. # 53 "/X11/R4/lib/include/X11/Xproto.h" 2
  1495.  
  1496. # 1 "/X11/R4/lib/include/X11/Xprotostr.h" 1
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524. # 1 "/X11/R4/lib/include/X11/Xmd.h" 1
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548. # 139 "/X11/R4/lib/include/X11/Xmd.h"
  1549.  
  1550. # 28 "/X11/R4/lib/include/X11/Xprotostr.h" 2
  1551.  
  1552.  
  1553.  
  1554.  
  1555. typedef struct _xSegment {
  1556.     INT16 x1  , y1  , x2  , y2  ;
  1557. } xSegment;
  1558.  
  1559.  
  1560.  
  1561. typedef struct _xPoint {
  1562.     INT16        x  , y  ;
  1563. } xPoint;
  1564.  
  1565. typedef struct _xRectangle {
  1566.     INT16 x  , y  ;
  1567.     CARD16  width  , height  ;
  1568. } xRectangle;
  1569.  
  1570.  
  1571.  
  1572. typedef struct _xArc {
  1573.     INT16 x  , y  ;
  1574.     CARD16   width  , height  ;
  1575.     INT16   angle1  , angle2  ;
  1576. } xArc;
  1577.  
  1578.  
  1579. # 54 "/X11/R4/lib/include/X11/Xproto.h" 2
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765. typedef CARD16 KeyButMask;
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772. typedef struct {
  1773.     CARD8    byteOrder;
  1774.     BYTE    pad;
  1775.     CARD16    majorVersion  , minorVersion  ;
  1776.     CARD16    nbytesAuthProto  ;     
  1777.     CARD16    nbytesAuthString  ;     
  1778.     CARD16    pad2;
  1779. } xConnClientPrefix;
  1780.  
  1781. typedef struct {
  1782.     BOOL           success;
  1783.     BYTE           lengthReason;  
  1784.     CARD16         majorVersion  , 
  1785.                    minorVersion  ;
  1786.     CARD16         length  ;   
  1787. } xConnSetupPrefix;
  1788.  
  1789.  
  1790. typedef struct {
  1791.     CARD32         release  ;
  1792.     CARD32         ridBase  , 
  1793.                    ridMask  ;
  1794.     CARD32         motionBufferSize  ;
  1795.     CARD16         nbytesVendor  ;   
  1796.     CARD16         maxRequestSize  ;
  1797.     CARD8          numRoots;           
  1798.     CARD8          numFormats;         
  1799.     CARD8          imageByteOrder;         
  1800.     CARD8          bitmapBitOrder;         
  1801.     CARD8          bitmapScanlineUnit,      
  1802.                    bitmapScanlinePad;      
  1803.     CARD8        minKeyCode, maxKeyCode;
  1804.     CARD32       pad2  ;
  1805. } xConnSetup;
  1806.  
  1807. typedef struct {
  1808.     CARD8          depth;
  1809.     CARD8          bitsPerPixel;
  1810.     CARD8          scanLinePad;
  1811.     CARD8          pad1;
  1812.     CARD32       pad2  ;
  1813. } xPixmapFormat;
  1814.  
  1815.  
  1816.  
  1817. typedef struct {
  1818.     CARD8     depth;
  1819.     CARD8     pad1;
  1820.     CARD16    nVisuals  ;   
  1821.     CARD32    pad2  ;
  1822.     } xDepth;
  1823.  
  1824. typedef struct {
  1825.     CARD32  visualID  ;
  1826.  
  1827.  
  1828.  
  1829.     CARD8 class;
  1830.  
  1831.     CARD8 bitsPerRGB;
  1832.     CARD16 colormapEntries  ;
  1833.     CARD32 redMask  , greenMask  , blueMask  ;
  1834.     CARD32 pad  ;
  1835.     } xVisualType;
  1836.  
  1837. typedef struct {
  1838.     CARD32          windowId  ;
  1839.     CARD32        defaultColormap  ;
  1840.     CARD32         whitePixel  , blackPixel  ;
  1841.     CARD32         currentInputMask  ;   
  1842.     CARD16         pixWidth  , pixHeight  ;
  1843.     CARD16         mmWidth  , mmHeight  ;
  1844.     CARD16         minInstalledMaps  , maxInstalledMaps  ;
  1845.     CARD32        rootVisualID  ;
  1846.     CARD8          backingStore;
  1847.     BOOL           saveUnders;
  1848.     CARD8          rootDepth;
  1849.     CARD8          nDepths;   
  1850. } xWindowRoot;
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860. typedef struct {
  1861.     CARD32 time  ;
  1862.     INT16 x  , y  ;
  1863. } xTimecoord;
  1864.  
  1865. typedef struct {
  1866.     CARD8 family;
  1867.     BYTE pad;
  1868.     CARD16 length  ;
  1869. } xHostEntry;
  1870.  
  1871. typedef struct {
  1872.     INT16 leftSideBearing  ,
  1873.       rightSideBearing  ,
  1874.       characterWidth  ,
  1875.       ascent  ,
  1876.       descent  ;
  1877.     CARD16 attributes  ;
  1878. } xCharInfo;
  1879.  
  1880. typedef struct {
  1881.     CARD32  name  ;
  1882.     CARD32 value  ;
  1883. } xFontProp;
  1884.  
  1885.  
  1886.  
  1887.  
  1888. typedef struct {            
  1889.     CARD8 len;     
  1890.  
  1891.     INT8 delta;
  1892. } xTextElt;
  1893.  
  1894.  
  1895. typedef struct {        
  1896.     CARD32 pixel  ;
  1897.     CARD16 red  , green  , blue  ;
  1898.     CARD8 flags;   
  1899.     CARD8 pad;
  1900. } xColorItem;
  1901.  
  1902.  
  1903. typedef struct {
  1904.     CARD16 red  , green  , blue  , pad  ;
  1905. } xrgb;
  1906.  
  1907. typedef CARD8 KEYCODE;
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915. # 945 "/X11/R4/lib/include/X11/Xproto.h"
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926. typedef struct {
  1927.     BYTE type;                   
  1928.     BYTE errorCode;
  1929.     CARD16 sequenceNumber  ;        
  1930.     CARD32 resourceID  ;
  1931.     CARD16 minorCode  ;
  1932.     CARD8 majorCode;
  1933.     BYTE pad1;
  1934.     CARD32 pad3  ;
  1935.     CARD32 pad4  ;
  1936.     CARD32 pad5  ;
  1937.     CARD32 pad6  ;
  1938.     CARD32 pad7  ;
  1939. } xError;
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946. # 1208 "/X11/R4/lib/include/X11/Xproto.h"
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956. # 1262 "/X11/R4/lib/include/X11/Xproto.h"
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968. typedef struct {
  1969.     CARD8 reqType;
  1970.     CARD8 data;             
  1971.     CARD16 length  ;          
  1972.  
  1973. } xReq;
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982. typedef struct {
  1983.     CARD8 reqType;
  1984.     BYTE pad;
  1985.     CARD16 length  ;
  1986.     CARD32 id  ;   
  1987.     } xResourceReq;
  1988.  
  1989. typedef struct {
  1990.     CARD8 reqType;
  1991.     CARD8 depth;
  1992.     CARD16 length  ;
  1993.     CARD32  wid  , parent  ;
  1994.     INT16 x  , y  ;
  1995.     CARD16 width  , height  , borderWidth  ;  
  1996.  
  1997.  
  1998.  
  1999.     CARD16 class  ;
  2000.  
  2001.     CARD32  visual  ;
  2002.     CARD32 mask  ;
  2003. } xCreateWindowReq;
  2004.  
  2005. typedef struct {
  2006.     CARD8 reqType;
  2007.     BYTE pad;
  2008.     CARD16 length  ;
  2009.     CARD32  window  ;
  2010.     CARD32 valueMask  ; 
  2011. } xChangeWindowAttributesReq;
  2012.  
  2013. typedef struct {
  2014.     CARD8 reqType;
  2015.     BYTE mode;
  2016.     CARD16 length  ;
  2017.     CARD32  window  ;
  2018. } xChangeSaveSetReq;
  2019.  
  2020. typedef struct {
  2021.     CARD8 reqType;
  2022.     BYTE pad;
  2023.     CARD16 length  ;
  2024.     CARD32  window  , parent  ;
  2025.     INT16 x  , y  ;
  2026. } xReparentWindowReq;
  2027.  
  2028. typedef struct {
  2029.     CARD8 reqType;
  2030.     CARD8 pad;
  2031.     CARD16 length  ;
  2032.     CARD32  window  ;
  2033.     CARD16 mask  ;
  2034.     CARD16 pad2  ;
  2035. } xConfigureWindowReq;
  2036.  
  2037. typedef struct {
  2038.     CARD8 reqType;
  2039.     CARD8 direction;
  2040.     CARD16 length  ;
  2041.     CARD32  window  ;
  2042. } xCirculateWindowReq;
  2043.  
  2044. typedef struct {     
  2045.     CARD8 reqType;
  2046.     BOOL onlyIfExists;
  2047.     CARD16 length  ;
  2048.     CARD16 nbytes   ;     
  2049.     CARD16 pad  ;
  2050. } xInternAtomReq;
  2051.  
  2052. typedef struct {
  2053.     CARD8 reqType;
  2054.     CARD8 mode;
  2055.     CARD16 length  ;
  2056.     CARD32  window  ;
  2057.     CARD32  property  , type  ;
  2058.     CARD8 format;
  2059.     BYTE pad[3];
  2060.     CARD32 nUnits  ;      
  2061. } xChangePropertyReq;
  2062.  
  2063. typedef struct {
  2064.     CARD8 reqType;
  2065.     BYTE pad;
  2066.     CARD16 length  ;
  2067.     CARD32  window  ;
  2068.     CARD32  property  ;
  2069. } xDeletePropertyReq;
  2070.  
  2071. typedef struct {
  2072.     CARD8 reqType;
  2073.  
  2074.  
  2075.  
  2076.     BOOL delete;
  2077.  
  2078.     CARD16 length  ;
  2079.     CARD32  window  ;
  2080.     CARD32  property  , type  ;
  2081.     CARD32 longOffset  ;
  2082.     CARD32 longLength  ;
  2083. } xGetPropertyReq;
  2084.  
  2085. typedef struct {
  2086.     CARD8 reqType;
  2087.     BYTE pad;
  2088.     CARD16 length  ;
  2089.     CARD32  window  ;
  2090.     CARD32  selection  ;
  2091.     CARD32  time  ;
  2092. } xSetSelectionOwnerReq;
  2093.  
  2094. typedef struct {
  2095.     CARD8 reqType;
  2096.     BYTE pad;
  2097.     CARD16 length  ;
  2098.     CARD32  requestor  ;
  2099.     CARD32  selection  , target  , property  ;
  2100.     CARD32  time  ;
  2101.     } xConvertSelectionReq;
  2102.  
  2103. # 1424 "/X11/R4/lib/include/X11/Xproto.h"
  2104.  
  2105.  
  2106. typedef struct {
  2107.     CARD8 reqType;
  2108.     BOOL ownerEvents;
  2109.     CARD16 length  ;
  2110.     CARD32  grabWindow  ;
  2111.     CARD16 eventMask  ;
  2112.     BYTE pointerMode, keyboardMode;
  2113.     CARD32  confineTo  ;
  2114.     CARD32  cursor  ;
  2115.     CARD32  time  ;
  2116. } xGrabPointerReq;
  2117.  
  2118. typedef struct {
  2119.     CARD8 reqType;
  2120.     BOOL ownerEvents;
  2121.     CARD16 length  ;
  2122.     CARD32  grabWindow  ;
  2123.     CARD16 eventMask  ;
  2124.     BYTE pointerMode, keyboardMode;
  2125.     CARD32  confineTo  ;
  2126.     CARD32  cursor  ;
  2127.     CARD8 button;
  2128.     BYTE pad;
  2129.     CARD16 modifiers  ;
  2130. } xGrabButtonReq;
  2131.  
  2132. typedef struct {
  2133.     CARD8 reqType;
  2134.     CARD8 button;
  2135.     CARD16 length  ;
  2136.     CARD32  grabWindow  ;
  2137.     CARD16 modifiers  ;
  2138.     CARD16 pad  ;
  2139. } xUngrabButtonReq;
  2140.  
  2141. typedef struct {
  2142.     CARD8 reqType;
  2143.     BYTE pad;
  2144.     CARD16 length  ;
  2145.     CARD32  cursor  ;
  2146.     CARD32  time  ;
  2147.     CARD16 eventMask  ;
  2148.     CARD16 pad2  ;
  2149. } xChangeActivePointerGrabReq;
  2150.  
  2151. typedef struct {
  2152.     CARD8 reqType;
  2153.     BOOL ownerEvents;
  2154.     CARD16 length  ;
  2155.     CARD32  grabWindow  ;
  2156.     CARD32  time  ;
  2157.     BYTE pointerMode, keyboardMode;  
  2158.     CARD16 pad  ;
  2159. } xGrabKeyboardReq;
  2160.  
  2161. typedef struct {
  2162.     CARD8 reqType;
  2163.     BOOL ownerEvents;
  2164.     CARD16 length  ;
  2165.     CARD32  grabWindow  ;
  2166.     CARD16 modifiers  ;
  2167.     CARD8 key;
  2168.     BYTE pointerMode, keyboardMode;  
  2169.     BYTE pad1, pad2, pad3;
  2170. } xGrabKeyReq;
  2171.  
  2172. typedef struct {
  2173.     CARD8 reqType;
  2174.     CARD8 key;
  2175.     CARD16 length  ;
  2176.     CARD32  grabWindow  ;
  2177.     CARD16 modifiers  ;
  2178.     CARD16 pad  ;
  2179. } xUngrabKeyReq;
  2180.  
  2181. typedef struct {
  2182.     CARD8 reqType;
  2183.     CARD8 mode;
  2184.     CARD16 length  ;
  2185.     CARD32  time  ;
  2186. } xAllowEventsReq;
  2187.  
  2188. typedef struct {
  2189.     CARD8 reqType;
  2190.     BYTE pad;
  2191.     CARD16 length  ;
  2192.     CARD32  window  ;
  2193.     CARD32  start  , stop  ;
  2194. } xGetMotionEventsReq;
  2195.  
  2196. typedef struct {
  2197.     CARD8 reqType;
  2198.     BYTE pad;
  2199.     CARD16 length  ;
  2200.     CARD32  srcWid  , dstWid  ;
  2201.     INT16 srcX  , srcY  ;
  2202. } xTranslateCoordsReq;
  2203.  
  2204. typedef struct {
  2205.     CARD8 reqType;
  2206.     BYTE pad;
  2207.     CARD16 length  ;
  2208.     CARD32  srcWid  , dstWid  ;
  2209.     INT16 srcX  , srcY  ;
  2210.     CARD16 srcWidth  , srcHeight  ;
  2211.     INT16 dstX  , dstY  ;
  2212. } xWarpPointerReq;
  2213.  
  2214. typedef struct {
  2215.     CARD8 reqType;
  2216.     CARD8 revertTo;
  2217.     CARD16 length  ;
  2218.     CARD32  focus  ;
  2219.     CARD32  time  ;
  2220. } xSetInputFocusReq;
  2221.  
  2222. typedef struct {
  2223.     CARD8 reqType;
  2224.     BYTE pad;
  2225.     CARD16 length  ;
  2226.     CARD32  fid  ;
  2227.     CARD16 nbytes  ;
  2228.     BYTE pad1, pad2;     
  2229. } xOpenFontReq;
  2230.  
  2231. typedef struct {
  2232.     CARD8 reqType;
  2233.     BOOL oddLength;
  2234.     CARD16 length  ;
  2235.     CARD32  fid  ;
  2236.     } xQueryTextExtentsReq;
  2237.  
  2238. typedef struct {
  2239.     CARD8 reqType;
  2240.     BYTE pad;
  2241.     CARD16 length  ;
  2242.     CARD16 maxNames  ;
  2243.     CARD16 nbytes  ;   
  2244. } xListFontsReq;
  2245.  
  2246. typedef xListFontsReq xListFontsWithInfoReq;
  2247.  
  2248. typedef struct {
  2249.     CARD8 reqType;
  2250.     BYTE pad;
  2251.     CARD16 length  ;
  2252.     CARD16 nFonts  ;
  2253.     BYTE pad1, pad2;     
  2254. } xSetFontPathReq;
  2255.  
  2256. typedef struct {
  2257.     CARD8 reqType;
  2258.     CARD8 depth;
  2259.     CARD16 length  ;
  2260.     CARD32  pid  ;
  2261.     CARD32  drawable  ;
  2262.     CARD16 width  , height  ;
  2263. } xCreatePixmapReq;
  2264.  
  2265. typedef struct {
  2266.     CARD8 reqType;
  2267.     BYTE pad;
  2268.     CARD16 length  ;
  2269.     CARD32  gc  ;
  2270.     CARD32  drawable  ;
  2271.     CARD32 mask  ;
  2272. } xCreateGCReq;
  2273.  
  2274. typedef struct {
  2275.     CARD8 reqType;
  2276.     BYTE pad;
  2277.     CARD16 length  ;
  2278.     CARD32  gc  ;
  2279.     CARD32 mask  ;
  2280. } xChangeGCReq;    
  2281.  
  2282. typedef struct {
  2283.     CARD8 reqType;
  2284.     BYTE pad;
  2285.     CARD16 length  ;
  2286.     CARD32  srcGC  , dstGC  ;
  2287.     CARD32 mask  ;
  2288. } xCopyGCReq;    
  2289.  
  2290. typedef struct {
  2291.     CARD8 reqType;
  2292.     BYTE pad;
  2293.     CARD16 length  ;
  2294.     CARD32  gc  ;
  2295.     CARD16 dashOffset  ;
  2296.     CARD16 nDashes  ;         
  2297. } xSetDashesReq;    
  2298.  
  2299. typedef struct {
  2300.     CARD8 reqType;
  2301.     BYTE ordering;
  2302.     CARD16 length  ;
  2303.     CARD32  gc  ;
  2304.     INT16 xOrigin  , yOrigin  ;
  2305. } xSetClipRectanglesReq;    
  2306.  
  2307. typedef struct {
  2308.     CARD8 reqType;
  2309.     BOOL exposures;
  2310.     CARD16 length  ;
  2311.     CARD32  window  ;
  2312.     INT16 x  , y  ;
  2313.     CARD16 width  , height  ;
  2314. } xClearAreaReq;
  2315.  
  2316. typedef struct {
  2317.     CARD8 reqType;
  2318.     BYTE pad;
  2319.     CARD16 length  ;
  2320.     CARD32  srcDrawable  , dstDrawable  ;
  2321.     CARD32  gc  ;
  2322.     INT16 srcX  , srcY  , dstX  , dstY  ;
  2323.     CARD16 width  , height  ;
  2324. } xCopyAreaReq;    
  2325.  
  2326. typedef struct {
  2327.     CARD8 reqType;
  2328.     BYTE pad;
  2329.     CARD16 length  ;
  2330.     CARD32  srcDrawable  , dstDrawable  ;
  2331.     CARD32  gc  ;
  2332.     INT16 srcX  , srcY  , dstX  , dstY  ;
  2333.     CARD16 width  , height  ;
  2334.     CARD32 bitPlane  ;
  2335. } xCopyPlaneReq;    
  2336.  
  2337. typedef struct {
  2338.     CARD8 reqType;
  2339.     BYTE coordMode;
  2340.     CARD16 length  ;
  2341.     CARD32  drawable  ;
  2342.     CARD32  gc  ;
  2343. } xPolyPointReq;    
  2344.  
  2345. typedef xPolyPointReq xPolyLineReq;   
  2346.  
  2347.  
  2348.  
  2349. typedef struct {
  2350.     CARD8 reqType;
  2351.     BYTE pad;
  2352.     CARD16 length  ;
  2353.     CARD32  drawable  ;
  2354.     CARD32  gc  ;
  2355. } xPolySegmentReq;    
  2356.  
  2357. typedef xPolySegmentReq xPolyArcReq;
  2358. typedef xPolySegmentReq xPolyRectangleReq;
  2359. typedef xPolySegmentReq xPolyFillRectangleReq;
  2360. typedef xPolySegmentReq xPolyFillArcReq;
  2361.  
  2362. typedef struct _FillPolyReq {
  2363.     CARD8 reqType;
  2364.     BYTE pad;
  2365.     CARD16 length  ;
  2366.     CARD32  drawable  ;
  2367.     CARD32  gc  ;
  2368.     BYTE shape;
  2369.     BYTE coordMode;
  2370.     CARD16 pad1  ;
  2371. } xFillPolyReq;    
  2372.  
  2373.  
  2374. typedef struct _PutImageReq {
  2375.     CARD8 reqType;
  2376.     CARD8 format;
  2377.     CARD16 length  ;
  2378.     CARD32  drawable  ;
  2379.     CARD32  gc  ;
  2380.     CARD16 width  , height  ;
  2381.     INT16 dstX  , dstY  ;
  2382.     CARD8 leftPad;
  2383.     CARD8 depth;
  2384.     CARD16 pad  ;
  2385. } xPutImageReq;    
  2386.  
  2387. typedef struct {
  2388.     CARD8 reqType;
  2389.     CARD8 format;
  2390.     CARD16 length  ;
  2391.     CARD32  drawable  ;
  2392.     INT16 x  , y  ;
  2393.     CARD16 width  , height  ;
  2394.     CARD32 planeMask  ;
  2395. } xGetImageReq;    
  2396.  
  2397.  
  2398.  
  2399. typedef struct {
  2400.     CARD8 reqType;
  2401.     CARD8 pad;
  2402.     CARD16 length  ;
  2403.     CARD32  drawable  ;
  2404.     CARD32  gc  ;
  2405.     INT16 x  , y  ;         
  2406. } xPolyTextReq;    
  2407.  
  2408. typedef xPolyTextReq xPolyText8Req;
  2409. typedef xPolyTextReq xPolyText16Req;
  2410.  
  2411. typedef struct {
  2412.     CARD8 reqType;
  2413.     BYTE nChars;
  2414.     CARD16 length  ;
  2415.     CARD32  drawable  ;
  2416.     CARD32  gc  ;
  2417.     INT16 x  , y  ;
  2418. } xImageTextReq;    
  2419.  
  2420. typedef xImageTextReq xImageText8Req;
  2421. typedef xImageTextReq xImageText16Req;
  2422.  
  2423. typedef struct {
  2424.     CARD8 reqType;
  2425.     BYTE alloc;
  2426.     CARD16 length  ;
  2427.     CARD32  mid  ;
  2428.     CARD32  window  ;
  2429.     CARD32  visual  ;
  2430. } xCreateColormapReq;    
  2431.  
  2432. typedef struct {
  2433.     CARD8 reqType;
  2434.     BYTE pad;
  2435.     CARD16 length  ;
  2436.     CARD32  mid  ;
  2437.     CARD32  srcCmap  ;
  2438. } xCopyColormapAndFreeReq;    
  2439.  
  2440. typedef struct {
  2441.     CARD8 reqType;
  2442.     BYTE pad;
  2443.     CARD16 length  ;
  2444.     CARD32  cmap  ;
  2445.     CARD16 red  , green  , blue  ;
  2446.     CARD16 pad2  ;
  2447. } xAllocColorReq;    
  2448.  
  2449. typedef struct {
  2450.     CARD8 reqType;
  2451.     BYTE pad;
  2452.     CARD16 length  ;
  2453.     CARD32  cmap  ;
  2454.     CARD16 nbytes  ;   
  2455.     BYTE pad1, pad2;
  2456. } xAllocNamedColorReq;    
  2457.  
  2458. typedef struct {
  2459.     CARD8 reqType;
  2460.     BOOL contiguous;
  2461.     CARD16 length  ;
  2462.     CARD32  cmap  ;
  2463.     CARD16 colors  , planes  ;
  2464. } xAllocColorCellsReq;    
  2465.  
  2466. typedef struct {
  2467.     CARD8 reqType;
  2468.     BOOL contiguous;
  2469.     CARD16 length  ;
  2470.     CARD32  cmap  ;
  2471.     CARD16 colors  , red  , green  , blue  ;
  2472. } xAllocColorPlanesReq;    
  2473.  
  2474. typedef struct {
  2475.     CARD8 reqType;
  2476.     BYTE pad;
  2477.     CARD16 length  ;
  2478.     CARD32  cmap  ;
  2479.     CARD32 planeMask  ;
  2480. } xFreeColorsReq;    
  2481.  
  2482. typedef struct {
  2483.     CARD8 reqType;
  2484.     BYTE pad;
  2485.     CARD16 length  ;
  2486.     CARD32  cmap  ;
  2487. } xStoreColorsReq;    
  2488.  
  2489. typedef struct {
  2490.     CARD8 reqType;
  2491.     CARD8 flags;    
  2492.     CARD16 length  ;
  2493.     CARD32  cmap  ;
  2494.     CARD32 pixel  ;
  2495.     CARD16 nbytes  ;   
  2496.     BYTE pad1, pad2;
  2497.     } xStoreNamedColorReq;
  2498.  
  2499. typedef struct {
  2500.     CARD8 reqType;
  2501.     BYTE pad;
  2502.     CARD16 length  ;
  2503.     CARD32  cmap  ;
  2504. } xQueryColorsReq;    
  2505.  
  2506. typedef struct {     
  2507.     CARD8 reqType;
  2508.     BYTE pad;
  2509.     CARD16 length  ;
  2510.     CARD32  cmap  ;
  2511.     CARD16 nbytes  ;   
  2512.     BYTE pad1, pad2;
  2513. } xLookupColorReq;    
  2514.  
  2515. typedef struct {
  2516.     CARD8 reqType;
  2517.     BYTE pad;
  2518.     CARD16 length  ;
  2519.     CARD32  cid  ;
  2520.     CARD32  source  , mask  ;
  2521.     CARD16 foreRed  , foreGreen  , foreBlue  ;
  2522.     CARD16 backRed  , backGreen  , backBlue  ;
  2523.     CARD16 x  , y  ;
  2524. } xCreateCursorReq;    
  2525.  
  2526. typedef struct {
  2527.     CARD8 reqType;
  2528.     BYTE pad;
  2529.     CARD16 length  ;
  2530.     CARD32  cid  ;
  2531.     CARD32  source  , mask  ;
  2532.     CARD16 sourceChar  , maskChar  ;
  2533.     CARD16 foreRed  , foreGreen  , foreBlue  ;
  2534.     CARD16 backRed  , backGreen  , backBlue  ;
  2535. } xCreateGlyphCursorReq;    
  2536.  
  2537. typedef struct {
  2538.     CARD8 reqType;
  2539.     BYTE pad;
  2540.     CARD16 length  ;
  2541.     CARD32  cursor  ;
  2542.     CARD16 foreRed  , foreGreen  , foreBlue  ;
  2543.     CARD16 backRed  , backGreen  , backBlue  ;
  2544. } xRecolorCursorReq;    
  2545.  
  2546. typedef struct {
  2547.     CARD8 reqType;
  2548.  
  2549.  
  2550.  
  2551.     CARD8 class;
  2552.  
  2553.     CARD16 length  ;
  2554.     CARD32  drawable  ;
  2555.     CARD16 width  , height  ;
  2556. } xQueryBestSizeReq;    
  2557.  
  2558. typedef struct {
  2559.     CARD8 reqType;
  2560.     BYTE pad;
  2561.     CARD16 length  ;
  2562.     CARD16 nbytes  ;   
  2563.     BYTE pad1, pad2;
  2564. } xQueryExtensionReq;
  2565.  
  2566. typedef struct {
  2567.     CARD8   reqType;
  2568.     CARD8   numKeyPerModifier;
  2569.     CARD16  length  ;
  2570. } xSetModifierMappingReq;
  2571.  
  2572. typedef struct {
  2573.     CARD8 reqType;
  2574.     CARD8 nElts;   
  2575.     CARD16 length  ;
  2576. } xSetPointerMappingReq;
  2577.  
  2578. typedef struct {
  2579.     CARD8 reqType;
  2580.     BYTE pad;
  2581.     CARD16 length  ;
  2582.     CARD8  firstKeyCode;
  2583.     CARD8 count;
  2584.     CARD16 pad1  ;
  2585. } xGetKeyboardMappingReq;    
  2586.  
  2587. typedef struct {
  2588.     CARD8 reqType;
  2589.     CARD8 keyCodes;
  2590.     CARD16 length  ;
  2591.     CARD8  firstKeyCode;
  2592.     CARD8 keySymsPerKeyCode;
  2593.     CARD16 pad1  ;
  2594. } xChangeKeyboardMappingReq;
  2595.  
  2596. typedef struct {
  2597.     CARD8 reqType;
  2598.     BYTE pad;
  2599.     CARD16 length  ;
  2600.     CARD32 mask  ;
  2601. } xChangeKeyboardControlReq;    
  2602.  
  2603. typedef struct {
  2604.     CARD8 reqType;
  2605.     INT8 percent;   
  2606.     CARD16 length  ;
  2607. } xBellReq;    
  2608.  
  2609. typedef struct {
  2610.     CARD8 reqType;
  2611.     BYTE pad;
  2612.     CARD16 length  ;
  2613.     INT16 accelNum  , accelDenum  ;
  2614.     INT16 threshold  ;             
  2615.     BOOL doAccel, doThresh;
  2616. } xChangePointerControlReq;    
  2617.  
  2618. typedef struct {
  2619.     CARD8 reqType;
  2620.     BYTE pad;
  2621.     CARD16 length  ;
  2622.     INT16 timeout  , interval  ;
  2623.     BYTE preferBlank, allowExpose;  
  2624.     CARD16 pad2  ;
  2625. } xSetScreenSaverReq;    
  2626.  
  2627. typedef struct {
  2628.     CARD8 reqType;
  2629.     BYTE mode;
  2630.     CARD16 length  ;
  2631.     CARD8 hostFamily;
  2632.     BYTE pad;
  2633.     CARD16 hostLength  ;
  2634. } xChangeHostsReq;    
  2635.  
  2636. typedef struct {
  2637.     CARD8 reqType;
  2638.     BYTE pad;
  2639.     CARD16 length  ;
  2640.     } xListHostsReq;
  2641.  
  2642. typedef struct {
  2643.     CARD8 reqType;
  2644.     BYTE mode;
  2645.     CARD16 length  ;
  2646.     } xChangeModeReq;
  2647.  
  2648. typedef xChangeModeReq xSetAccessControlReq;
  2649. typedef xChangeModeReq xSetCloseDownModeReq;
  2650. typedef xChangeModeReq xForceScreenSaverReq;
  2651.  
  2652. typedef struct {  
  2653.     CARD8 reqType;
  2654.     BYTE pad;
  2655.     CARD16 length  ;
  2656.     CARD32  window  ;
  2657.     CARD16 nAtoms  ;
  2658.     INT16 nPositions  ;
  2659.     } xRotatePropertiesReq;
  2660.     
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806. # 29 "access.c" 2
  2807.  
  2808. # 1 "/X11/R4/src/cmds/X/include/misc.h" 1
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841. extern unsigned long globalSerialNumber;
  2842. extern unsigned long serverGeneration;
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857. typedef unsigned char *pointer;
  2858. typedef int Bool;
  2859. typedef unsigned long PIXEL;
  2860. typedef unsigned long ATOM;
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867. # 1 "/X11/R4/src/cmds/X/include/os.h" 1
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896. # 1 "/X11/R4/src/cmds/X/include/misc.h" 1
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921. # 148 "/X11/R4/src/cmds/X/include/misc.h"
  2922.  
  2923. # 29 "/X11/R4/src/cmds/X/include/os.h" 2
  2924.  
  2925.  
  2926.  
  2927. # 1 "/sprite/lib/include/sun4.md/alloca.h" 1
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955. # 32 "/X11/R4/src/cmds/X/include/os.h" 2
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971. typedef pointer    FID;
  2972. typedef struct _FontPathRec *FontPathPtr;
  2973. typedef struct _NewClientRec *NewClientPtr;
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981. # 70 "/X11/R4/src/cmds/X/include/os.h"
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989. # 91 "/X11/R4/src/cmds/X/include/os.h"
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004. int        ReadRequestFromClient();
  3005. char        *strcat();
  3006. char        *strncat();
  3007. char        *strcpy();
  3008. char        *strncpy();
  3009. Bool        CloseDownConnection();
  3010. FontPathPtr    GetFontPath();
  3011. FontPathPtr    ExpandFontNamePattern();
  3012. FID        FiOpenForRead();
  3013. void        CreateWellKnownSockets();
  3014. int        SetDefaultFontPath();
  3015. void        FreeFontRecord();
  3016. int        SetFontPath();
  3017. void        ErrorF();
  3018. void        Error();
  3019. void        FatalError();
  3020. void        ProcessCommandLine();
  3021. void        Xfree();
  3022. void        FlushAllOutput();
  3023. void        FlushIfCriticalOutputPending();
  3024. unsigned long    *Xalloc();
  3025. unsigned long    *Xrealloc();
  3026. long        GetTimeInMillis();
  3027.  
  3028.  
  3029. # 59 "/X11/R4/src/cmds/X/include/misc.h" 2
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.      
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113. extern void SwapLongs();
  3114. extern void SwapShorts();
  3115.  
  3116. typedef struct _DDXPoint *DDXPointPtr;
  3117. typedef struct _Box *BoxPtr;
  3118.  
  3119.  
  3120. # 30 "access.c" 2
  3121.  
  3122. # 1 "/X11/R4/src/cmds/X/include/site.h" 1
  3123.  
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200. # 31 "access.c" 2
  3201.  
  3202. # 1 "/sprite/lib/include/errno.h" 1
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224. extern int    errno;         
  3225.  
  3226. extern int    sys_nerr;     
  3227. extern char    *sys_errlist[];     
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309. # 32 "access.c" 2
  3310.  
  3311. # 1 "/sprite/lib/include/sys/socket.h" 1
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370. struct    linger {
  3371.     int    l_onoff;         
  3372.     int    l_linger;         
  3373. };
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381.  
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.  
  3388.  
  3389.  
  3390.  
  3391.  
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407. struct sockaddr {
  3408.     u_short    sa_family;         
  3409.     char    sa_data[14];         
  3410. };
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416. struct sockproto {
  3417.     u_short    sp_family;         
  3418.     u_short    sp_protocol;         
  3419. };
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.  
  3452. struct msghdr {
  3453.     caddr_t    msg_name;         
  3454.     int    msg_namelen;         
  3455.     struct    iovec *msg_iov;         
  3456.     int    msg_iovlen;         
  3457.     caddr_t    msg_accrights;         
  3458.     int    msg_accrightslen;
  3459. };
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468. # 33 "access.c" 2
  3469.  
  3470. # 1 "/sprite/lib/include/sys/ioctl.h" 1
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484. # 1 "/sprite/lib/include/sys/ttychars.h" 1
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499. struct ttychars {
  3500.     char    tc_erase;     
  3501.     char    tc_kill;     
  3502.     char    tc_intrc;     
  3503.     char    tc_quitc;     
  3504.     char    tc_startc;     
  3505.     char    tc_stopc;     
  3506.     char    tc_eofc;     
  3507.     char    tc_brkc;     
  3508.     char    tc_suspc;     
  3509.     char    tc_dsuspc;     
  3510.     char    tc_rprntc;     
  3511.     char    tc_flushc;     
  3512.     char    tc_werasc;     
  3513.     char    tc_lnextc;     
  3514. };
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535. # 14 "/sprite/lib/include/sys/ioctl.h" 2
  3536.  
  3537.  
  3538.  
  3539. # 1 "/sprite/lib/include/sys/ttydev.h" 1
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575. # 17 "/sprite/lib/include/sys/ioctl.h" 2
  3576.  
  3577.  
  3578.  
  3579.  
  3580. # 1 "/sprite/lib/include/sys/fb.h" 1
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647. typedef struct    fbtype {
  3648.     int    fb_type;     
  3649.     int    fb_height;     
  3650.     int    fb_width;     
  3651.     int    fb_depth;     
  3652.     int    fb_cmsize;     
  3653.     int    fb_size;     
  3654. } fbtype;
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661. typedef struct    fbinfo {
  3662.     int        fb_physaddr;     
  3663.     int        fb_hwwidth;     
  3664.     int        fb_hwheight;     
  3665.     int        fb_addrdelta;     
  3666.     unsigned char    *fb_ropaddr;     
  3667.     int        fb_unit;     
  3668. } fbinfo;
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675. typedef struct    fbcmap {
  3676.     int        index;         
  3677.     int        count;         
  3678.     unsigned char    *red;         
  3679.     unsigned char    *green;         
  3680.     unsigned char    *blue;         
  3681. } fbcmap;
  3682.  
  3683.  
  3684. typedef struct fbsattr {
  3685.     int    flags;             
  3686.  
  3687.  
  3688.     int    emu_type;         
  3689.     int    dev_specific[8    ];     
  3690. } fbsattr;
  3691.  
  3692.  
  3693. typedef struct fbgattr {
  3694.     int    real_type;         
  3695.     int    owner;             
  3696.     struct    fbtype fbtype;         
  3697.     struct    fbsattr sattr;         
  3698.     int    emu_types[4    ];     
  3699.                          
  3700. } fbgattr;
  3701.  
  3702. struct    fbpixrect {
  3703.     struct pixrect    *fbpr_pixrect;     
  3704. };
  3705.  
  3706.  
  3707.  
  3708.  
  3709. # 21 "/sprite/lib/include/sys/ioctl.h" 2
  3710.  
  3711.  
  3712.  
  3713. # 1 "/sprite/lib/include/cfuncproto.h" 1
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733. # 76 "/sprite/lib/include/cfuncproto.h"
  3734.  
  3735.  
  3736. # 24 "/sprite/lib/include/sys/ioctl.h" 2
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743. struct tchars {
  3744.     char    t_intrc;     
  3745.     char    t_quitc;     
  3746.     char    t_startc;     
  3747.     char    t_stopc;     
  3748.     char    t_eofc;         
  3749.     char    t_brkc;         
  3750. };
  3751. struct ltchars {
  3752.     char    t_suspc;     
  3753.     char    t_dsuspc;     
  3754.     char    t_rprntc;     
  3755.     char    t_flushc;     
  3756.     char    t_werasc;     
  3757.     char    t_lnextc;     
  3758. };
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766. struct sgttyb {
  3767.     char    sg_ispeed;         
  3768.     char    sg_ospeed;         
  3769.     char    sg_erase;         
  3770.     char    sg_kill;         
  3771.     short    sg_flags;         
  3772. };
  3773.  
  3774.  
  3775.  
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783. struct winsize {
  3784.     unsigned short    ws_row;             
  3785.     unsigned short    ws_col;             
  3786.     unsigned short    ws_xpixel;         
  3787.     unsigned short    ws_ypixel;         
  3788. };
  3789.  
  3790.  
  3791.  
  3792.  
  3793. struct ttysize {
  3794.     unsigned short    ts_lines;
  3795.     unsigned short    ts_cols;
  3796.     unsigned short    ts_xxx;
  3797.     unsigned short    ts_yyy;
  3798. };
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.  
  3971.  
  3972.  
  3973.  
  3974.  
  3975.  
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025. extern int ioctl () ;
  4026.  
  4027.  
  4028. # 34 "access.c" 2
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.  
  4035.  
  4036.  
  4037. # 1 "/sprite/lib/include/net/if.h" 1
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085. struct ifnet {
  4086.     char    *if_name;         
  4087.     short    if_unit;         
  4088.     short    if_mtu;             
  4089.     short    if_flags;         
  4090.     short    if_timer;         
  4091.     int    if_metric;         
  4092.     struct    ifaddr *if_addrlist;     
  4093.     struct    ifqueue {
  4094.         struct    mbuf *ifq_head;
  4095.         struct    mbuf *ifq_tail;
  4096.         int    ifq_len;
  4097.         int    ifq_maxlen;
  4098.         int    ifq_drops;
  4099.     } if_snd;             
  4100.  
  4101.     int    (*if_init)();         
  4102.     int    (*if_output)();         
  4103.     int    (*if_ioctl)();         
  4104.     int    (*if_reset)();         
  4105.     int    (*if_watchdog)();     
  4106.  
  4107.     int    if_ipackets;         
  4108.     int    if_ierrors;         
  4109.     int    if_opackets;         
  4110.     int    if_oerrors;         
  4111.     int    if_collisions;         
  4112.  
  4113.     struct    ifnet *if_next;
  4114. };
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.  
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139. # 110 "/sprite/lib/include/net/if.h"
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154. # 132 "/sprite/lib/include/net/if.h"
  4155.  
  4156. # 143 "/sprite/lib/include/net/if.h"
  4157.  
  4158. # 152 "/sprite/lib/include/net/if.h"
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169. struct ifaddr {
  4170.     struct    sockaddr ifa_addr;     
  4171.     union {
  4172.         struct    sockaddr ifu_broadaddr;
  4173.         struct    sockaddr ifu_dstaddr;
  4174.     } ifa_ifu;
  4175.  
  4176.  
  4177.     struct    ifnet *ifa_ifp;         
  4178.     struct    ifaddr *ifa_next;     
  4179. };
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187. struct    ifreq {
  4188.  
  4189.     char    ifr_name[16 ];         
  4190.     union {
  4191.         struct    sockaddr ifru_addr;
  4192.         struct    sockaddr ifru_dstaddr;
  4193.         struct    sockaddr ifru_broadaddr;
  4194.         short    ifru_flags;
  4195.         int    ifru_metric;
  4196.         caddr_t    ifru_data;
  4197.     } ifr_ifru;
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204. };
  4205.  
  4206. struct ifdevea {
  4207.         char    ifr_name[16 ];
  4208.         u_char default_pa[6];
  4209.         u_char current_pa[6];
  4210. }; 
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218. struct    ifconf {
  4219.     int    ifc_len;         
  4220.     union {
  4221.         caddr_t    ifcu_buf;
  4222.         struct    ifreq *ifcu_req;
  4223.     } ifc_ifcu;
  4224.  
  4225.  
  4226. };
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235. # 1 "/sprite/lib/include/net/if_arp.h" 1
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241.  
  4242.  
  4243.  
  4244.  
  4245.  
  4246.  
  4247.  
  4248.  
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254. # 1 "/sprite/lib/include/sys/socket.h" 1
  4255.  
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269. # 156 "/sprite/lib/include/sys/socket.h"
  4270.  
  4271. # 19 "/sprite/lib/include/net/if_arp.h" 2
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284. struct    arphdr {
  4285.     u_short    ar_hrd;         
  4286.  
  4287.     u_short    ar_pro;         
  4288.     u_char    ar_hln;         
  4289.     u_char    ar_pln;         
  4290.     u_short    ar_op;         
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307. };
  4308.  
  4309.  
  4310.  
  4311.  
  4312. struct arpreq {
  4313.     struct    sockaddr arp_pa;         
  4314.     struct    sockaddr arp_ha;         
  4315.     int    arp_flags;             
  4316. };
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325. # 228 "/sprite/lib/include/net/if.h" 2
  4326.  
  4327.  
  4328.  
  4329.  
  4330. # 42 "access.c" 2
  4331.  
  4332.  
  4333.  
  4334. # 1 "/sprite/lib/include/netdb.h" 1
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359. struct    hostent {
  4360.     char    *h_name;     
  4361.     char    **h_aliases;     
  4362.     int    h_addrtype;     
  4363.     int    h_length;     
  4364.     char    **h_addr_list;     
  4365.  
  4366. };
  4367.  
  4368.  
  4369.  
  4370.  
  4371.  
  4372. struct    netent {
  4373.     char        *n_name;     
  4374.     char        **n_aliases;     
  4375.     int        n_addrtype;     
  4376.     unsigned long    n_net;         
  4377. };
  4378.  
  4379. struct    servent {
  4380.     char    *s_name;     
  4381.     char    **s_aliases;     
  4382.     int    s_port;         
  4383.     char    *s_proto;     
  4384. };
  4385.  
  4386. struct    protoent {
  4387.     char    *p_name;     
  4388.     char    **p_aliases;     
  4389.     int    p_proto;     
  4390. };
  4391.  
  4392. struct hostent    *gethostbyname(), *gethostbyaddr(), *gethostent();
  4393. struct netent    *getnetbyname(), *getnetbyaddr(), *getnetent();
  4394. struct servent    *getservbyname(), *getservbyport(), *getservent();
  4395. struct protoent    *getprotobyname(), *getprotobynumber(), *getprotoent();
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409. # 45 "access.c" 2
  4410.  
  4411.  
  4412. # 1 "/sprite/lib/include/netinet/in.h" 1
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431. # 1 "/sprite/lib/include/sun4.md/machparam.h" 1
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.  
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458. # 1 "/sprite/lib/include/sun4.md/limits.h" 1
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.  
  4497.  
  4498.  
  4499.  
  4500.  
  4501.  
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536. # 27 "/sprite/lib/include/sun4.md/machparam.h" 2
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579. # 19 "/sprite/lib/include/netinet/in.h" 2
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624. struct in_addr {
  4625.     u_long s_addr;
  4626. };
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.  
  4646.  
  4647.  
  4648.  
  4649.  
  4650.  
  4651.  
  4652.  
  4653.  
  4654.  
  4655.  
  4656.  
  4657.  
  4658.  
  4659.  
  4660.  
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.  
  4667. struct sockaddr_in {
  4668.     short    sin_family;
  4669.     u_short    sin_port;
  4670.     struct    in_addr sin_addr;
  4671.     char    sin_zero[8];
  4672. };
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694. # 47 "access.c" 2
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702. # 1 "/sprite/lib/include/stdio.h" 1
  4703.  
  4704.  
  4705.  
  4706.  
  4707.  
  4708.  
  4709.  
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732. # 1 "/sprite/lib/include/cfuncproto.h" 1
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752. # 76 "/sprite/lib/include/cfuncproto.h"
  4753.  
  4754.  
  4755. # 30 "/sprite/lib/include/stdio.h" 2
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  
  4765.  
  4766.  
  4767.  
  4768.  
  4769.  
  4770.  
  4771. typedef int *ClientData;
  4772.  
  4773.  
  4774.  
  4775.  
  4776.  
  4777. typedef char *va_list;
  4778.  
  4779.  
  4780.  
  4781.  
  4782.  
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830. typedef struct _file {
  4831.     unsigned char *lastAccess;     
  4832.  
  4833.  
  4834.     int readCount;         
  4835.  
  4836.  
  4837.     int writeCount;         
  4838.  
  4839.  
  4840.  
  4841.  
  4842.  
  4843.     unsigned char *buffer;     
  4844.  
  4845.     int bufSize;         
  4846.  
  4847.  
  4848.     void (*readProc)() ;
  4849.                  
  4850.     void (*writeProc)() ;
  4851.                  
  4852.     int (*closeProc)() ;
  4853.                  
  4854.  
  4855.     ClientData clientData;     
  4856.  
  4857.  
  4858.     int status;             
  4859.  
  4860.  
  4861.     int flags;             
  4862.  
  4863.     struct _file *nextPtr;     
  4864.  
  4865.  
  4866.  
  4867.  
  4868. } FILE;
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.  
  4892.  
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982. extern FILE stdioInFile, stdioOutFile, stdioErrFile;
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.         extern  void    clearerr () ;
  5020.         extern  int    fclose () ;
  5021.         extern  FILE *    fdopen () ;
  5022.         extern  int    fflush () ;
  5023.         extern  int    fgetc () ;
  5024.         extern  char *    fgets () ;
  5025.         extern  int    fileno () ;
  5026.         extern  FILE *    fopen () ;
  5027.         extern  int    fputc () ;
  5028.         extern  int    fputs () ;
  5029.         extern  int    fread () ;
  5030.  
  5031.         extern  FILE *    freopen () ;
  5032.  
  5033.         extern  long    fseek () ;
  5034.         extern  long    ftell () ;
  5035.         extern  int    fwrite () ;
  5036.  
  5037.         extern  char *    gets () ;
  5038.         extern  int    getw () ;
  5039.         extern  void    perror () ;
  5040.         extern  FILE *    popen () ;
  5041.         extern  int    pclose () ;
  5042.         extern  int      remove () ;
  5043.         extern  int      rename () ;
  5044.  
  5045. # 336 "/sprite/lib/include/stdio.h"
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.  
  5053.  
  5054.         extern  int    printf () ;
  5055.         extern  int    fprintf () ;
  5056.         extern  int    scanf () ;
  5057.         extern  char *    sprintf () ;
  5058.         extern  int    sscanf () ;
  5059.         extern  int    fscanf () ;
  5060.         extern  int    vfprintf () ;
  5061.  
  5062.         extern  int    vfscanf () ;
  5063.  
  5064.         extern  int    vprintf () ;
  5065.         extern  char *    vsprintf () ;
  5066.  
  5067.  
  5068.  
  5069.         extern  int    puts () ;
  5070.         extern  int    putw () ;
  5071.         extern  void    rewind () ;
  5072.         extern  void    setbuf () ;
  5073.         extern  void    setbuffer () ;
  5074.         extern  void    setlinebuf () ;
  5075.         extern  int    setvbuf () ;
  5076.         extern  FILE *    tmpfile () ;
  5077.         extern  char *    tmpnam () ;
  5078.         extern  char *    tempnam () ;
  5079.         extern  int    ungetc () ;
  5080.         extern  void    _cleanup () ;
  5081.  
  5082.         extern  void    Stdio_Setup () ;
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090. # 54 "access.c" 2
  5091.  
  5092. # 1 "/X11/R4/src/cmds/X/include/dixstruct.h" 1
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110.  
  5111.  
  5112.  
  5113.  
  5114.  
  5115.  
  5116.  
  5117.  
  5118.  
  5119.  
  5120.  
  5121. # 1 "/X11/R4/src/cmds/X/include/dix.h" 1
  5122.  
  5123.  
  5124.  
  5125.  
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150. # 1 "/X11/R4/src/cmds/X/include/gc.h" 1
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.  
  5166.  
  5167.  
  5168.  
  5169.  
  5170.  
  5171.  
  5172.  
  5173.  
  5174.  
  5175.  
  5176.  
  5177.  
  5178.  
  5179.  
  5180.  
  5181.  
  5182.  
  5183.  
  5184.  
  5185.  
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205. typedef struct _GCInterest *GCInterestPtr;
  5206. typedef struct _GC    *GCPtr;
  5207. extern void  ValidateGC();
  5208. extern int ChangeGC();
  5209. extern GCPtr CreateGC();
  5210. extern int CopyGC();
  5211. extern int FreeGC();
  5212. extern void SetGCMask();
  5213. extern GCPtr GetScratchGC();
  5214. extern void  FreeScratchGC();
  5215.  
  5216. # 29 "/X11/R4/src/cmds/X/include/dix.h" 2
  5217.  
  5218. # 1 "/X11/R4/src/cmds/X/include/window.h" 1
  5219.  
  5220.  
  5221.  
  5222.  
  5223.  
  5224.  
  5225.  
  5226.  
  5227.  
  5228.  
  5229.  
  5230.  
  5231.  
  5232.  
  5233.  
  5234.  
  5235.  
  5236.  
  5237.  
  5238.  
  5239.  
  5240.  
  5241.  
  5242.  
  5243.  
  5244.  
  5245.  
  5246.  
  5247.  
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259. typedef struct _BackingStore *BackingStorePtr;
  5260. typedef struct _Window *WindowPtr;
  5261.  
  5262.  
  5263. # 30 "/X11/R4/src/cmds/X/include/dix.h" 2
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.  
  5288.  
  5289.  
  5290.  
  5291.  
  5292.  
  5293.  
  5294.  
  5295.  
  5296.  
  5297.  
  5298.  
  5299.  
  5300. # 75 "/X11/R4/src/cmds/X/include/dix.h"
  5301.  
  5302.  
  5303. # 116 "/X11/R4/src/cmds/X/include/dix.h"
  5304.  
  5305.  
  5306.  
  5307.  
  5308.  
  5309.  
  5310.  
  5311.  
  5312.  
  5313.  
  5314.  
  5315.  
  5316. typedef struct _TimeStamp *TimeStampPtr;
  5317. typedef struct _Client *ClientPtr;
  5318. extern ClientPtr requestingClient;
  5319. extern ClientPtr *clients;
  5320. extern ClientPtr serverClient;
  5321. extern int currentMaxClients;
  5322.  
  5323. extern int ProcAllowEvents();
  5324. extern int ProcBell();
  5325. extern int ProcChangeActivePointerGrab();
  5326. extern int ProcChangeKeyboardControl();
  5327. extern int ProcChangePointerControl();
  5328. extern int ProcGetKeyboardMapping();
  5329. extern int ProcGetPointerMapping();
  5330. extern int ProcGetInputFocus();
  5331. extern int ProcGetKeyboardControl();
  5332. extern int ProcGetMotionEvents();
  5333. extern int ProcGetPointerControl();
  5334. extern int ProcGrabButton();
  5335. extern int ProcGrabKey();
  5336. extern int ProcGrabKeyboard();
  5337. extern int ProcGrabPointer();
  5338. extern int ProcQueryKeymap();
  5339. extern int ProcQueryPointer();
  5340. extern int ProcSetInputFocus();
  5341. extern int ProcSetKeyboardMapping();
  5342. extern int ProcSetPointerMapping();
  5343. extern int ProcSendEvent();
  5344. extern int ProcUngrabButton();
  5345. extern int ProcUngrabKey();
  5346. extern int ProcUngrabKeyboard();
  5347. extern int ProcUngrabPointer();
  5348. extern int ProcWarpPointer();
  5349. extern int ProcRecolorCursor();
  5350.  
  5351. extern WindowPtr LookupWindow();
  5352. extern pointer LookupDrawable();
  5353.  
  5354. extern void NoopDDA();
  5355.  
  5356.  
  5357. # 29 "/X11/R4/src/cmds/X/include/dixstruct.h" 2
  5358.  
  5359. # 1 "/X11/R4/src/cmds/X/include/resource.h" 1
  5360.  
  5361.  
  5362.  
  5363.  
  5364.  
  5365.  
  5366.  
  5367.  
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376.  
  5377.  
  5378.  
  5379.  
  5380.  
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386. # 1 "/X11/R4/src/cmds/X/include/misc.h" 1
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.  
  5407.  
  5408.  
  5409.  
  5410.  
  5411. # 148 "/X11/R4/src/cmds/X/include/misc.h"
  5412.  
  5413. # 27 "/X11/R4/src/cmds/X/include/resource.h" 2
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.  
  5420.  
  5421.  
  5422. typedef unsigned long RESTYPE;
  5423.  
  5424.  
  5425.  
  5426.  
  5427.  
  5428.  
  5429.  
  5430.  
  5431.  
  5432.  
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.  
  5439.  
  5440.  
  5441.  
  5442.  
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457. RESTYPE CreateNewResourceType();
  5458. RESTYPE CreateNewResourceClass();
  5459. unsigned long FakeClientID();
  5460. Bool AddResource();
  5461. void FreeResource();
  5462. void FreeClientResources();
  5463. Bool LegalNewID();
  5464. pointer LookupIDByType();
  5465. pointer LookupIDByClass();
  5466.  
  5467.  
  5468. # 30 "/X11/R4/src/cmds/X/include/dixstruct.h" 2
  5469.  
  5470. # 1 "/X11/R4/src/cmds/X/include/cursor.h" 1
  5471.  
  5472.  
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.  
  5486.  
  5487.  
  5488.  
  5489.  
  5490.  
  5491.  
  5492.  
  5493.  
  5494.  
  5495.  
  5496.  
  5497.  
  5498.  
  5499. typedef struct _Cursor *CursorPtr;
  5500. typedef struct _CursorMetric *CursorMetricPtr;
  5501.  
  5502. extern CursorPtr rootCursor;
  5503.  
  5504. # 31 "/X11/R4/src/cmds/X/include/dixstruct.h" 2
  5505.  
  5506. # 1 "/X11/R4/src/cmds/X/include/gc.h" 1
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533. # 65 "/X11/R4/src/cmds/X/include/gc.h"
  5534.  
  5535. # 32 "/X11/R4/src/cmds/X/include/dixstruct.h" 2
  5536.  
  5537. # 1 "/X11/R4/src/cmds/X/include/pixmap.h" 1
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.  
  5553.  
  5554.  
  5555.  
  5556.  
  5557.  
  5558.  
  5559.  
  5560.  
  5561.  
  5562.  
  5563.  
  5564.  
  5565.  
  5566.  
  5567.  
  5568.  
  5569.  
  5570.  
  5571.  
  5572.  
  5573.  
  5574.  
  5575.  
  5576. typedef struct _Drawable *DrawablePtr;    
  5577. typedef struct _Pixmap *PixmapPtr;
  5578.  
  5579. typedef union _PixUnion {
  5580.     PixmapPtr        pixmap;
  5581.     unsigned long    pixel;
  5582. } PixUnion;
  5583.  
  5584.  
  5585.  
  5586.  
  5587.  
  5588.  
  5589.  
  5590.  
  5591. # 33 "/X11/R4/src/cmds/X/include/dixstruct.h" 2
  5592.  
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599. typedef struct _TimeStamp {
  5600.     unsigned long    months;             
  5601.     unsigned long    milliseconds;
  5602. } TimeStamp;
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608. typedef struct _Client {
  5609.     int index;
  5610.     Mask clientAsMask;
  5611.     pointer requestBuffer;
  5612.     pointer osPrivate;             
  5613.     Bool swapped;
  5614.     void (* pSwapReplyFunc)();        
  5615.     XID    errorValue;
  5616.     int sequence;
  5617.     int closeDownMode;
  5618.     int clientGone;
  5619.     int noClientException;        
  5620.     DrawablePtr lastDrawable;
  5621.     Drawable lastDrawableID;
  5622.     GCPtr lastGC;
  5623.     GContext lastGCID;    
  5624.     pointer *saveSet;
  5625.     int numSaved;
  5626.     pointer screenPrivate[3 ];
  5627.     int (**requestVector)();
  5628.  
  5629.  
  5630.  
  5631.  
  5632. } ClientRec;
  5633.  
  5634. extern TimeStamp currentTime;
  5635. extern void CloseDownClient();
  5636.  
  5637. extern TimeStamp ClientTimeToServerTime();
  5638. extern void UpdateCurrentTime();
  5639. extern void UpdateCurrentTimeIf();
  5640.  
  5641.  
  5642. # 55 "access.c" 2
  5643.  
  5644. # 1 "osdep.h" 1
  5645.  
  5646.  
  5647.  
  5648.  
  5649.  
  5650.  
  5651.  
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.  
  5690.  
  5691.  
  5692.  
  5693.  
  5694.  
  5695.  
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701.  
  5702.  
  5703.  
  5704.  
  5705.  
  5706.  
  5707. # 76 "osdep.h"
  5708.  
  5709. # 93 "osdep.h"
  5710.  
  5711. # 114 "osdep.h"
  5712.  
  5713.  
  5714. # 137 "osdep.h"
  5715.  
  5716.  
  5717. typedef struct _connectionInput {
  5718.     struct _connectionInput *next;
  5719.     char *buffer;                
  5720.     char *bufptr;                
  5721.     int  bufcnt;                 
  5722.     int lenLastReq;
  5723.     int size;
  5724. } ConnectionInput, *ConnectionInputPtr;
  5725.  
  5726. typedef struct _connectionOutput {
  5727.     struct _connectionOutput *next;
  5728.     int size;
  5729.     unsigned char *buf;
  5730.     int count;
  5731. } ConnectionOutput, *ConnectionOutputPtr;
  5732.  
  5733. typedef struct _osComm {
  5734.     int fd;
  5735.     ConnectionInputPtr input;
  5736.     ConnectionOutputPtr output;
  5737.     XID    auth_id;         
  5738.     long conn_time;         
  5739. } OsCommRec, *OsCommPtr;
  5740. # 56 "access.c" 2
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.  
  5749.  
  5750.  
  5751.  
  5752.  
  5753.  
  5754. extern char    *index();
  5755.  
  5756. static int XFamily(), UnixFamily();
  5757. static int ConvertAddr(), CheckAddr();
  5758. static void NewHost();
  5759.  
  5760. typedef struct _host {
  5761.     short        family;
  5762.     short        len;
  5763.  
  5764.  
  5765.  
  5766.     unsigned char    addr[4];     
  5767.  
  5768.     struct _host *next;
  5769. } HOST;
  5770.  
  5771. static HOST *selfhosts = 0 ;
  5772. static HOST *validhosts = 0 ;
  5773. static int AccessEnabled = 0  ;
  5774. static int LocalHostEnabled = 0 ;
  5775. static int UsingXdmcp = 0 ;
  5776.  
  5777. typedef struct {
  5778.     int af, xf;
  5779. } FamilyMap;
  5780.  
  5781. static FamilyMap familyMap[] = {
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.     {    2        ,     0 }
  5795.  
  5796.  
  5797. };
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804. EnableLocalHost ()
  5805. {
  5806.     if (!UsingXdmcp)
  5807.     {
  5808.     LocalHostEnabled = 1 ;
  5809.     AddLocalHosts ();
  5810.     }
  5811. }
  5812.  
  5813.  
  5814.  
  5815.  
  5816.  
  5817.  
  5818. AccessUsingXdmcp ()
  5819. {
  5820.     UsingXdmcp = 1 ;
  5821.     LocalHostEnabled = 0 ;
  5822. }
  5823.  
  5824.  
  5825.  
  5826. # 201 "access.c"
  5827.  
  5828.  
  5829.  
  5830.  
  5831. DefineSelf (fd)
  5832.     int fd;
  5833. {
  5834.     char        buf[2048];
  5835.     struct ifconf    ifc;
  5836.     register int    n;
  5837.     int         len;
  5838.     pointer         addr;
  5839.     int         family;
  5840.     register HOST     *host;
  5841.     register struct ifreq *ifr;
  5842.     
  5843. # 245 "access.c"
  5844.  
  5845.     ifc.ifc_len = sizeof (buf);
  5846.     ifc.ifc_ifcu.ifcu_buf     = buf;
  5847.     if (ioctl (fd, (int) ((int) ((    0x80000000    |    0x40000000    ) |((sizeof( struct ifconf)&0x1fff        )<<16)|('i'<<8)|20))     , (pointer) &ifc) < 0)
  5848.         Error ("Getting interface configuration");
  5849.     for (ifr = ifc.ifc_ifcu.ifcu_req    , n = ifc.ifc_len / sizeof (struct ifreq); --n >= 0;
  5850.      ifr++)
  5851.     {
  5852.     len = sizeof(ifr->ifr_ifru.ifru_addr    );
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.         if ((family = ConvertAddr (&ifr->ifr_ifru.ifru_addr    , &len, &addr)) <= 0)
  5861.         continue;
  5862.         for (host = selfhosts;
  5863.           host && !((family) == ( host)->family &&    ( len) == ( host)->len &&    !bcmp((char *)( addr), (char *)( ( host)->addr),   len) ) ;
  5864.          host = host->next)
  5865.         ;
  5866.         if (host)
  5867.         continue;
  5868.         host = (HOST *) Xalloc((unsigned long)(sizeof (HOST))) ;
  5869.     if (host)
  5870.     {
  5871.         host->family = family;
  5872.         host->len = len;
  5873.         bcopy((char *)(addr), (char *)( host->addr),  len) ;
  5874.         host->next = selfhosts;
  5875.         selfhosts = host;
  5876.     }
  5877. # 314 "access.c"
  5878.  
  5879.     }
  5880. }
  5881.  
  5882.  
  5883. # 350 "access.c"
  5884.  
  5885.  
  5886. AddLocalHosts ()
  5887. {
  5888.     HOST    *self;
  5889.  
  5890.     for (self = selfhosts; self; self = self->next)
  5891.     NewHost (self->family, self->addr, self->len);
  5892. }
  5893.  
  5894.  
  5895. ResetHosts (display)
  5896.     char *display;
  5897. {
  5898.     register HOST    *host;
  5899.     char         hostname[120];
  5900.     char        fname[32];
  5901.     FILE        *fd;
  5902.     char        *ptr;
  5903.     union {
  5904.         struct sockaddr    sa;
  5905.  
  5906.         struct sockaddr_in in;
  5907.  
  5908.  
  5909.  
  5910.  
  5911.     }             saddr;
  5912.  
  5913.  
  5914.  
  5915.  
  5916.     int            family;
  5917.     int            len;
  5918.     pointer        addr;
  5919.     register struct hostent *hp;
  5920.  
  5921.     AccessEnabled = 0  ;
  5922.     LocalHostEnabled = 0 ;
  5923.     while (host = validhosts)
  5924.     {
  5925.         validhosts = host->next;
  5926.         Xfree((pointer)(host)) ;
  5927.     }
  5928.     strcpy (fname, "/etc/X");
  5929.     strcat (fname, display);
  5930.     strcat (fname, ".hosts");
  5931.     if (fd = fopen (fname, "r")) 
  5932.     {
  5933.         while (fgets (hostname, sizeof (hostname), fd))
  5934.     {
  5935.         if (ptr = index (hostname, '\n'))
  5936.             *ptr = 0;
  5937. # 428 "access.c"
  5938.  
  5939.  
  5940.              
  5941.             if (hp = gethostbyname (hostname))
  5942.         {
  5943.             saddr.sa.sa_family = hp->h_addrtype;
  5944.         len = sizeof(saddr.sa);
  5945.             if ((family = ConvertAddr (&saddr.sa, &len, &addr)) > 0)
  5946.  
  5947.         {
  5948.             char **list;
  5949.  
  5950.              
  5951.             for (list = hp->h_addr_list; *list; list++)
  5952.             NewHost (family, (pointer)*list, len);
  5953.         }
  5954.  
  5955.  
  5956.  
  5957.  
  5958.             }
  5959.  
  5960.  
  5961.  
  5962.  
  5963.         }
  5964.         fclose (fd);
  5965.     }
  5966. }
  5967.  
  5968. static Bool
  5969. AuthorizedClient(client)
  5970.     ClientPtr client;
  5971. {
  5972.     int            alen, family;
  5973.     struct sockaddr    from;
  5974.     pointer        addr;
  5975.     register HOST    *host;
  5976.  
  5977.     alen = sizeof (from);
  5978.     if (!getpeername (((OsCommPtr)client->osPrivate)->fd, &from, &alen))
  5979.     {
  5980.         if ((family = ConvertAddr (&from, &alen, &addr)) >= 0)
  5981.     {
  5982.         if (family == 0)
  5983.         return 1 ;
  5984.         for (host = selfhosts; host; host = host->next)
  5985.         {
  5986.         if (((family) == ( host)->family &&    ( alen) == ( host)->len &&    !bcmp((char *)( addr), (char *)( ( host)->addr),   alen) ) )
  5987.             return 1 ;
  5988.         }
  5989.     }
  5990.     }
  5991.     return 0 ;
  5992. }
  5993.  
  5994.  
  5995.  
  5996.  
  5997. int
  5998. AddHost (client, family, length, pAddr)
  5999.     ClientPtr        client;
  6000.     int                 family;
  6001.     unsigned            length;         
  6002.     pointer             pAddr;
  6003. {
  6004.     int            len;
  6005.     register HOST    *host;
  6006.     int                 unixFamily;
  6007.  
  6008.     if (!AuthorizedClient(client))
  6009.     return(  10    );
  6010.     unixFamily = UnixFamily(family);
  6011.     if (unixFamily < 0)
  6012.     {
  6013.     client->errorValue = family;
  6014.     return (   2    );
  6015.     }
  6016.     if ((len = CheckAddr (unixFamily, pAddr, length)) < 0)
  6017.     {
  6018.     client->errorValue = length;
  6019.         return (   2    );
  6020.     }
  6021.     for (host = validhosts; host; host = host->next)
  6022.     {
  6023.         if (((unixFamily) == ( host)->family &&    ( len) == ( host)->len &&    !bcmp((char *)( pAddr), (char *)( ( host)->addr),   len) ) )
  6024.             return (       0    );
  6025.     }
  6026.     host = (HOST *) Xalloc((unsigned long)(sizeof (HOST))) ;
  6027.     if (!host)
  6028.     return(  11    );
  6029.     host->family = unixFamily;
  6030.     host->len = len;
  6031.     bcopy((char *)(pAddr), (char *)( host->addr),  len) ;
  6032.     host->next = validhosts;
  6033.     validhosts = host;
  6034.     return (       0    );
  6035. }
  6036.  
  6037.  
  6038.  
  6039. static void
  6040. NewHost (family, addr, len)
  6041.     short    family;
  6042.     pointer    addr;
  6043.     int        len;
  6044. {
  6045.     register HOST *host;
  6046.  
  6047.     for (host = validhosts; host; host = host->next)
  6048.     {
  6049.         if (((family) == ( host)->family &&    ( len) == ( host)->len &&    !bcmp((char *)( addr), (char *)( ( host)->addr),   len) ) )
  6050.         return;
  6051.     }
  6052.     host = (HOST *) Xalloc((unsigned long)(sizeof (HOST))) ;
  6053.     if (host)
  6054.     {
  6055.     host->family = family;
  6056.     host->len = len;
  6057.     bcopy((char *)(addr), (char *)( host->addr),  len) ;
  6058.     host->next = validhosts;
  6059.     validhosts = host;
  6060.     }
  6061. }
  6062.  
  6063.  
  6064.  
  6065. int
  6066. RemoveHost (client, family, length, pAddr)
  6067.     ClientPtr        client;
  6068.     int                 family;
  6069.     unsigned            length;         
  6070.     pointer             pAddr;
  6071. {
  6072.     int            len,
  6073.                         unixFamily;
  6074.     register HOST    *host, **prev;
  6075.  
  6076.     if (!AuthorizedClient(client))
  6077.     return(  10    );
  6078.     unixFamily = UnixFamily(family);
  6079.     if (unixFamily < 0)
  6080.     {
  6081.     client->errorValue = family;
  6082.         return(   2    );
  6083.     }
  6084.     if ((len = CheckAddr (unixFamily, pAddr, length)) < 0)
  6085.     {
  6086.     client->errorValue = length;
  6087.         return(   2    );
  6088.     }
  6089.     for (prev = &validhosts;
  6090.          (host = *prev) && (!((unixFamily) == ( host)->family &&    ( len) == ( host)->len &&    !bcmp((char *)( pAddr), (char *)( ( host)->addr),   len) ) );
  6091.          prev = &host->next)
  6092.         ;
  6093.     if (host)
  6094.     {
  6095.         *prev = host->next;
  6096.         Xfree((pointer)(host)) ;
  6097.     }
  6098.     return (       0    );
  6099. }
  6100.  
  6101.  
  6102. int
  6103. GetHosts (data, pnHosts, pLen, pEnabled)
  6104.     pointer        *data;
  6105.     int            *pnHosts;
  6106.     int            *pLen;
  6107.     BOOL        *pEnabled;
  6108. {
  6109.     int            len;
  6110.     register int     n = 0;
  6111.     register pointer    ptr;
  6112.     register HOST    *host;
  6113.     int            nHosts = 0;
  6114.     int            *lengths = (int *) 0 ;
  6115.     int            *newlens;
  6116.  
  6117.     *pEnabled = AccessEnabled ?     1       :     0 ;
  6118.     for (host = validhosts; host; host = host->next)
  6119.     {
  6120.     newlens = (int *) Xrealloc((pointer)(lengths), (unsigned long)( (nHosts + 1) * sizeof(int))) ;
  6121.     if (!newlens)
  6122.     {
  6123.         Xfree((pointer)(lengths)) ;
  6124.         return(  11    );
  6125.     }
  6126.     lengths = newlens;
  6127.     lengths[nHosts++] = host->len;
  6128.     n += (((host->len + 3) >> 2) << 2) + sizeof(xHostEntry);
  6129.     }
  6130.     if (n)
  6131.     {
  6132.         *data = ptr = (pointer) Xalloc((unsigned long)(n)) ;
  6133.     if (!ptr)
  6134.     {
  6135.         Xfree((pointer)(lengths)) ;
  6136.         return(  11    );
  6137.     }
  6138.     nHosts = 0;
  6139.         for (host = validhosts; host; host = host->next)
  6140.     {
  6141.  
  6142.         len = lengths[nHosts++];
  6143.         ((xHostEntry *)ptr)->family = XFamily(host->family);
  6144.         ((xHostEntry *)ptr)->length = len;
  6145.         ptr += sizeof(xHostEntry);
  6146.         bcopy((char *)(host->addr), (char *)( ptr),  len) ;
  6147.         ptr += ((len + 3) >> 2) << 2;
  6148.         }
  6149.     } else {
  6150.     *data = 0 ;
  6151.     }
  6152.     *pnHosts = nHosts;
  6153.     *pLen = n;
  6154.     Xfree((pointer)(lengths)) ;
  6155.     return(       0    );
  6156. }
  6157.  
  6158.  
  6159.  
  6160.  
  6161. static int
  6162. CheckAddr (family, pAddr, length)
  6163.     int            family;
  6164.     pointer        pAddr;
  6165.     unsigned        length;
  6166. {
  6167.     int    len;
  6168.  
  6169.     switch (family)
  6170.     {
  6171.  
  6172.       case     2        :
  6173.     if (length == sizeof (struct in_addr))
  6174.         len = length;
  6175.     else
  6176.         len = -1;
  6177.         break;
  6178.  
  6179. # 683 "access.c"
  6180.  
  6181.       default:
  6182.         len = -1;
  6183.     }
  6184.     return (len);
  6185. }
  6186.  
  6187.  
  6188.  
  6189.  
  6190. InvalidHost (saddr, len)
  6191.     register struct sockaddr    *saddr;
  6192.     int                len;
  6193. {
  6194.     int             family;
  6195.     pointer            addr;
  6196.     register HOST         *selfhost, *host;
  6197.  
  6198.     if (!AccessEnabled)    
  6199.         return(0);    
  6200.     if ((family = ConvertAddr (saddr, &len, &addr)) < 0)
  6201.         return (1);
  6202.     if (family == 0)
  6203.     {
  6204.     if (!LocalHostEnabled)
  6205.      {
  6206.          
  6207.  
  6208.  
  6209.  
  6210.         for (selfhost = selfhosts; selfhost; selfhost=selfhost->next)
  6211.          {
  6212.         for (host = validhosts; host; host=host->next)
  6213.         {
  6214.             if (((selfhost->family) == ( host)->family &&    (
  6215.                    selfhost->len) == ( host)->len &&    !bcmp((char *)( selfhost->addr), (char *)( ( host)->addr),  
  6216.                    selfhost->len) ) )
  6217. # 719 "access.c"
  6218.             return 0;
  6219.         }
  6220.         }
  6221.         return 1;
  6222.     } else
  6223.         return (0);
  6224.     }
  6225.     for (host = validhosts; host; host = host->next)
  6226.     {
  6227.         if (((family) == ( host)->family &&    ( len) == ( host)->len &&    !bcmp((char *)( addr), (char *)( ( host)->addr),   len) ) )
  6228.             return (0);
  6229.     }
  6230.     return (1);
  6231. }
  6232.  
  6233. static int
  6234. ConvertAddr (saddr, len, addr)
  6235.     register struct sockaddr    *saddr;
  6236.     int                *len;
  6237.     pointer            *addr;
  6238. {
  6239.     if (*len == 0)
  6240.         return (0);
  6241.     switch (saddr->sa_family)
  6242.     {
  6243.       case 0        :
  6244.  
  6245.  
  6246.  
  6247.         return (0);
  6248.  
  6249.  
  6250.       case     2        :
  6251.         *len = sizeof (struct in_addr);
  6252.         *addr = (pointer) &(((struct sockaddr_in *) saddr)->sin_addr);
  6253.         return (    2        );
  6254.  
  6255.  
  6256. # 765 "access.c"
  6257.  
  6258.  
  6259.       default:
  6260.         break;
  6261.     }
  6262.     return (-1);
  6263. }
  6264.  
  6265. int
  6266. ChangeAccessControl(client, fEnabled)
  6267.     ClientPtr client;
  6268.     int fEnabled;
  6269. {
  6270.     if (!AuthorizedClient(client))
  6271.     return   10    ;
  6272.     AccessEnabled = fEnabled;
  6273.     return        0    ;
  6274. }
  6275.  
  6276. static int XFamily(af)
  6277.     int af;
  6278. {
  6279.     int i;
  6280.     for (i = 0; i < ((sizeof familyMap)/(sizeof familyMap[0])) ; i++)
  6281.         if (familyMap[i].af == af)
  6282.             return familyMap[i].xf;
  6283.     return -1;
  6284. }
  6285.  
  6286. static int UnixFamily(xf)
  6287.     int xf;
  6288. {
  6289.     int i;
  6290.     for (i = 0; i < ((sizeof familyMap)/(sizeof familyMap[0])) ; i++)
  6291.         if (familyMap[i].xf == xf)
  6292.             return familyMap[i].af;
  6293.     return -1;
  6294. }
  6295.  
  6296.